import sys
from PyQt5.QtWidgets import QApplication,QMainWindow,QHBoxLayout, QPushButton, QWidget

def onClincked():
    print("onClincked")
    print("x:", widget.x(), "y:",widget.y())

    size1 = widget.geometry()
    print(size1.height(), size1.width())

    size = widget.frameGeometry()
    print(size.height(), size.width())

app = QApplication(sys.argv)
widget = QWidget()
btn = QPushButton(widget)
btn.clicked.connect(onClincked)
btn.setText("ok")
btn.move(24, 52)

widget.resize(300, 200)#"工作区域"
widget.move(300,300)
widget.setWindowTitle("screen coord")
widget.show()

sys.exit(app.exec_())

